<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
</head>
<script type="text/javascript" runat="server">
function fileList(folderspec)
{
	var fso, f, f1, fc, s;
	fso = new ActiveXObject("Scripting.FileSystemObject");
	f = fso.GetFolder(folderspec);
	fc = new Enumerator(f.files);
	s = "";
	for (; !fc.atEnd(); fc.moveNext())
	{

		s += fc.item().name + ",";

	}
	
	//take care of the comma as the last character
	s = s.slice(0, s.length - 1);
	return(s);
}

</script>
<body>
<script type="text/javascript">
var strFiles = fileList("X:\XML");
var iLen = 0; 
iLen = strFiles.length;
document.write(iLen);
</script>

</body>
</html>
